﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YinfangWeb.BLL.Model
{
    /// <summary>
    /// 商品列表对象
    /// </summary>
    public class ObjProduct
    {
        public string FileName { get; set; }
        public int ProductDataID { get; set; }
        public string ProductName { get; set; }
        public string KindName { get; set; }        
        public int TotalSell { get; set; }
        public int SellBase { get; set; }
        public int TotalStock { get; set; }
        public int ProductState { get; set; }
        public string RegFullName { get; set; }
        public string RegDateTime { get; set; }
        //以下为商城专用
        public int PriceMarket { get; set; }
    }
    /// <summary>
    /// 商品卡片对象
    /// </summary>
    public class ObjProductCard
    {
        public string FileName { get; set; }
        public int ProductDataID { get; set; }
        public string ProductName { get; set; }
        public int TotalSell { get; set; }
        public int SellBase { get; set; }
        public int PriceMarket { get; set; }
        public int PriceSell { get; set; }
    }
    /// <summary>
    /// 图标对象
    /// </summary>
    public class ObjProductLogo
    {
        [JsonProperty("id")]
        public int ProductFileID { get; set; }
        [JsonProperty("url")]
        public string Url { get; set; }
    }
    /// <summary>
    /// 图片列表对象
    /// </summary>
    public class ObjProductLogoList
    {
        [JsonProperty("http_head")]
        public string HttpHead { get; set; }
        [JsonProperty("logo_list")]
        public List<string> LogoList { get; set; }
    }
    /// <summary>
    /// 商品基本数据及属性参数母板
    /// </summary>
    public class ObjProductCreateResult
    {
        [JsonProperty("id")]
        public int ProductDataID { get; set; }
        [JsonProperty("state")]
        public int ProductState { get; set; }
        [JsonProperty("merchant_id")]
        public int MerchantDataID { get; set; }
        [JsonProperty("type")]
        public int ProductType { get; set; }
        [JsonProperty("kind_id")]
        public int ProductKindID { get; set; }
        [JsonProperty("name")]
        public string ProductName { get; set; }
        [JsonProperty("link_url")]
        public string LinkURL { get; set; }
        [JsonProperty("is_activity")]
        public bool IsActivity { get; set; }
        [JsonProperty("is_recommend")]
        public bool IsRecommend { get; set; }
        [JsonProperty("is_top")]
        public bool IsTop { get; set; }
        [JsonProperty("is_must_num")]
        public bool IsMustbuy { get; set; }
        [JsonProperty("limit_month_num")]
        public int LimitMonth { get; set; }
        [JsonProperty("sell_base")]
        public int SellBase { get; set; }
        [JsonProperty("html")]
        public string ProductInfo { get; set; }
        [JsonProperty("param_id")]
        public int ProductParamID { get; set; }
        [JsonProperty("price_market")]
        public decimal PriceMarket { get; set; }
        [JsonProperty("price_sell")]
        public decimal PriceSell { get; set; }
        [JsonProperty("price_net")]
        public decimal PriceNet { get; set; }
        [JsonProperty("price_tax")]
        public decimal PriceTax { get; set; }
        [JsonProperty("price_post")]
        public decimal PricePost { get; set; }
        [JsonProperty("price_cost")]
        public decimal PriceCost { get; set; }
        [JsonProperty("coin_deduct")]
        public int CoinDeduct { get; set; }
        [JsonProperty("stock")]
        public int Stock { get; set; }
        [JsonProperty("default_logo_id")]
        public int DefaultProductFileID { get; set; }
    }
    /// <summary>
    /// 商品编辑信息
    /// </summary>
    public class ObjProductEditInfo
    {
        [JsonProperty("sp_head")]
        public ObjProductCreateResult SpHead { get; set; }
        [JsonProperty("sp_html")]
        public string SpHtml { get; set; }
        [JsonProperty("sp_showpic_list")]
        public List<string> SpShowPicList { get; set; }
        [JsonProperty("http_head")]
        public string HttpHead { get; set; }
    }
    /// <summary>
    /// 商品属性名及值
    /// </summary>
    public class ObjProductAttrible
    {
        [JsonProperty("name")]
        public string Name { get; set; }
        [JsonProperty("values")]
        public List<string> Values { get; set; }
    }
    /// <summary>
    /// 商品属性类型、属性
    /// </summary>
    public class ObjProductParam
    {
        [JsonProperty("type")]
        public int AttrType { get; set; }
        [JsonProperty("attr")]
        public List<ObjProductAttrible> Attrible { get; set; }
    }
    /// <summary>
    /// 商品种类选择对象
    /// </summary>
    public class ObjProductKindSelect
    {
        [JsonProperty("value")]
        public int ProductKindID { get; set; }
        [JsonProperty("label")]
        public string KindName { get; set; }
        [JsonProperty("children")]
        public List<ObjProductKindSelect> Children { get; set; }
        public ObjProductKindSelect()
        {
            KindName = string.Empty;
            Children = null;
        }
    }
    /// <summary>
    /// 商品种类下一个ID对象
    /// </summary>
    public class ObjProductKindNextLevelID
    {
        [JsonProperty("one_level_id")]
        public int OneLevelID { get; set; }
        [JsonProperty("next_two_level_id")]
        public int NextTwoLevelID { get; set; }
        [JsonProperty("next_two_level_order")]
        public int NextTwoLevelOrder { get; set; }
    }
    /// <summary>
    /// 商城首页行的列对象
    /// </summary>
    public class ObjProductKindUnite
    {
        [JsonProperty("name")]
        public string Name { get; set; }
        [JsonProperty("list")]
        public List<ObjProductCard> CardList{ get; set; }
    }
    /// <summary>
    /// 商城首页行对象
    /// </summary>
    public class ObjProductRowUnite
    {
        [JsonProperty("title")]
        public string Title { get; set; }
        [JsonProperty("sp_list")]
        public List<ObjProductCard> CardList { get; set; }
        [JsonProperty("type_list")]
        public List<ObjProductKindUnite> TypeList { get; set; }
    }
}
